package com.project.poetry.service.controller;

import com.project.poetry.service.entity.dto.money.MoneyLoanDTO;
import com.project.poetry.service.entity.dto.money.MoneyLoanOutDTO;
import com.project.poetry.service.service.MoneyRateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 计算贷款金额控制器
 * @author mengxj
 */
@Api("计算贷款金额")
@Validated
@RestController
@RequestMapping("moneyRate")
public class MoneyRateController {

    @Resource
    private MoneyRateService moneyRateService;

    @ApiOperation("房贷明细")
    @PostMapping("housingLoan")
    public MoneyLoanOutDTO housingLoan(@RequestBody MoneyLoanDTO moneyLoan){
        return this.moneyRateService.housingLoan(moneyLoan);
    }
}
